//////////////////////////////
// trame
void send_start_trame(void)
{
  btSerial.print("#");
}
void send_end_trame(void)
{
  btSerial.println("$");
}
void send_data(char *str)
{
  btSerial.print(str);
}


//////////////////////////////
// error
void send_error(String err)
{
  char e[256];
  err.toCharArray(e, sizeof(e));
  send_error(e);
}
void send_error(char *error)
{
  send_start_trame();
  send_data("error:");
  send_data(error);
  send_end_trame();
}

//////////////////////////////
// message
void send_message(String msg)
{
  char m[256];
  msg.toCharArray(m, sizeof(m));
  send_message(m);
}
void send_message(char *msg)
{
  send_start_trame();
  send_data("message:");
  send_data(msg);
  send_end_trame();
}

//////////////////////////////
// version
void send_version(void)
{
  send_start_trame();
  send_data("version:name=shaky,version=0.0");
  send_end_trame();
}

